
        <?php
            header("Content-type:text/html;charset=utf-8");
                    $con = mysqli_connect("localhost", 'root', '', 'ksdb2');
                    mysqli_set_charset($con, "utf8");
            $id = $_GET["id"];

            // 执行要删除的sql语句
            $sql = "DELETE FROM course WHERE course.cs_id = $id;";

            if($con->query($sql)) //执行sql语句
            {
                echo "删除成功";
            //删完回去表页面
            }
            else{
                echo "删除失败";
            }

            // 回到首页
            header("Location:course.php");
            mysqli_close($con);
        ?>

